<template>
  <div class="settings-menu">
    <div class="menu-header">
      <h3>系统设置</h3>
    </div>
    <el-menu
      :default-active="activeMenu"
      class="menu-list"
      @select="handleSelect"
    >
      <el-menu-item index="users">
        <el-icon><User /></el-icon>
        <span>人员管理</span>
      </el-menu-item>
      <el-menu-item index="directories">
        <el-icon><Folder /></el-icon>
        <span>目录管理</span>
      </el-menu-item>
      <el-menu-item index="permissions">
        <el-icon><Lock /></el-icon>
        <span>权限管理</span>
      </el-menu-item>
    </el-menu>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { User, Folder, Lock } from '@element-plus/icons-vue'

const emit = defineEmits(['select'])

const activeMenu = ref('users')

const handleSelect = (index) => {
  activeMenu.value = index
  emit('select', index)
}
</script>

<style scoped>
.settings-menu {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.menu-header {
  padding: 20px;
  border-bottom: 1px solid #e6e6e6;
}

.menu-header h3 {
  margin: 0;
  font-size: 16px;
  color: #303133;
}

.menu-list {
  flex: 1;
  border-right: none;
}

.menu-list :deep(.el-menu-item) {
  height: 50px;
  line-height: 50px;
}

.menu-list :deep(.el-menu-item.is-active) {
  background-color: #ecf5ff;
  color: #409EFF;
}
</style> 